<?php
namespace ImiDemo\HttpDemo\MainServer\Model;

use Imi\Model\Model;
use Imi\Model\Annotation\Table;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\Entity;
use Imi\Model\Annotation\Relation\JoinTo;
use Imi\Model\Annotation\Relation\AutoSave;
use Imi\Model\Annotation\Relation\JoinFrom;
use Imi\Model\Annotation\Relation\OneToOne;

/**
 * UserEx
 * @Entity
 * @Table(name="tb_user_ex", id={"user_id"})
 * @property int $userId
 * @property string $intro
 */
class UserEx extends Model
{
    /**
     * @OneToOne("UserSns")
     * @JoinTo("user_id")
     * @AutoSave(true)
     *
     * @var \ImiDemo\HttpDemo\MainServer\Model\UserSns
     */
    protected $sns;

    /**
     * Get the value of sns
     *
     * @return  \ImiDemo\HttpDemo\MainServer\Model\UserSns
     */ 
    public function getSns()
    {
        return $this->sns;
    }

    /**
     * Set the value of sns
     *
     * @param  \ImiDemo\HttpDemo\MainServer\Model\UserSns  $sns
     *
     * @return  self
     */ 
    public function setSns(\ImiDemo\HttpDemo\MainServer\Model\UserSns $sns)
    {
        $this->sns = $sns;

        return $this;
    }
    
    /**
     * user_id
     * @Column(name="user_id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=false)
     * @var int
     */
    protected $userId;

    /**
     * 获取 userId
     *
     * @return int
     */ 
    public function getUserId()
    {
        return $this->userId;
    }

    /**
     * 赋值 userId
     * @param int $userId user_id
     * @return static
     */ 
    public function setUserId($userId)
    {
        $this->userId = $userId;
        return $this;
    }

    /**
     * intro
     * @Column(name="intro", type="text", length=0, accuracy=0, nullable=false, default="", isPrimaryKey=false, primaryKeyIndex=-1, isAutoIncrement=false)
     * @var string
     */
    protected $intro;

    /**
     * 获取 intro
     *
     * @return string
     */ 
    public function getIntro()
    {
        return $this->intro;
    }

    /**
     * 赋值 intro
     * @param string $intro intro
     * @return static
     */ 
    public function setIntro($intro)
    {
        $this->intro = $intro;
        return $this;
    }

}